/*
* $Id: Component.cpp 143 2010-09-09 19:55:18Z volok-aleksej@yandex.ru $
*
* Copyright 2008 by Volokitin Alexey
* All rights reserved
*
*/
#include "Common/include.h"
#include "Settings/InterfaceStn.h"
#include "Component.h"

CComponent::CComponent(unsigned int IdString, IVisualComponent* pVisualComponent)
: m_IdString(IdString){
	m_pVisualComponent = pVisualComponent;
}

CComponent::~CComponent(){
	for(std::vector<ISetting*>::iterator it = m_aSettings.begin(); it != m_aSettings.end(); it++)
		(*it)->Free();
	m_pVisualComponent->Free();
}

std::vector<ISetting*> CComponent::GetSettings(){
	return m_aSettings;
}

std::tstring CComponent::GetNameComponent(){
	return ILanguageManager::GetLanguageManager()->GetString(m_IdString);
}

IVisualComponent* CComponent::GetVisualComponent(){
	return m_pVisualComponent;
}

void CComponent::Free(){
	delete this;
}
